﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

namespace MyTcpIp.acceleration
{
    /// <summary>
    /// ACC通道数据
    /// </summary>
    /// 

    public struct ChannelAccData
    {
        public UInt16 ChID;
        /// <summary>
        /// 原始数据
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 131072)]
        public Int32[] RawData;
        /// <summary>
        /// FFT频谱
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)]
        public float[] FFTAmpDB;
        /// <summary>
        /// FFT幅值
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)]
        public float[] FFTAmp;
        /// <summary>
        /// FFT能量值
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)]
        public float[] FFTPower;

        /// <summary>
        /// 速度FFT幅值
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)]
        public float[] elocityFFTAmp;

        /// <summary>
        /// 震动加速度总值
        /// </summary>
        public float TotalDB;

        /// <summary>
        /// （大于315hz）高频段总值
        /// </summary>
        public float highDB;

        public float lowDB;

        //1/3倍频程
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)]
        public float[] _1_3otcaveDB;

        //均方根值 
        public float velocityRMS;
        //平均电压
        public float AverageVol;
        //位移RMS
        public float displacementRMS;
        //一倍频幅值
        public float OneMultiplierAmp;
        //二倍频幅值                                        
        public float TWOMultiplierAmp;
        //三倍频幅值                                                
        public float HalfMultiplierAmp;
        //报警标志                           	
        public byte AlarmFlag;
    }
}
